﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AIthin.Neuro
{
    /// <summary>
    /// Model of neuron´s dentrit
    /// </summary>
    public class Dendrit
    {
        public float Weight;
        public float Signal = 0;
        public int ConnectedNeuron = 0;
        public int ConnectedAxon = 0;
        //public static float SignalRange = 1.0f;
        protected static Random random = new Random();
        public bool Activated = false;
        public Dendrit()
        {
            //TODO for input neurons weight is constant
            Weight = 1.0f; // Convert.ToSingle(random.NextDouble());
        }
        public float Out()
        {
            Debug.Write(this.ConnectedNeuron, "connected neuron");
            Debug.WriteLine (Signal * Weight, " dendrit out");
            return Signal * Weight;
        }
    }
}
